import request from './index.js'

//用户登录接口
export const userLogin = (data) => request({url:'/logon',method:'POST',data:data})

//修改用户信息
export const changeUserInfo = (data) => request({url:'/user',method:'PUT',data:data})

//修改密码
export const changeUserPassword = (data) => request({url:'/userPwd',method:'PUT',data:data})

//用户注册
export const userRegister = (data) => request({url:'/users',method:'POST',data:data})

//获取验证码
export const getCaptcha = (email) => request({url:`/Captcha?emails=${email}`,loading:false})

//获取头像列表
export const getUserImg = () => request({url:'/head'})

//用户退出
export const userLogout = (id) => request({url:`/logonOut?user_id=${id}`,method:'POST'})

//忘记密码邮箱验证
export const yanzhengEmail = (email,captcha) => request({url:`/forgetPwd?email=${email}&captcha=${captcha}`})

//验证成功直接修改密码 用户登录情况下
export const changePassword = (data) => request({url:'/forgetPwd',method:'PUT',data:data})

//验证成功直接修改密码 用户未登录情况下
export const changePassword2 = (data) => request({url:'/forgetLoginPwd',method:'PUT',data:data})




//获取用户博客浏览记录
export const getUserBlogFoot = (id,num,size) => request({url:`/browse?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//获取用户博客点赞列表
export const getUserBlogLike = (id,num,size) => request({url:`/remark?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//获取用户博客收藏列表
export const getUserBlogCollection = (id,num,size) => request({url:`/collect?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//删除博客浏览记录
export const deleteUserBlogFoot = (id,user_id) => request({url:`/deleteBrowse?id=${id}&user_id=${user_id}`,method:'DELETE'})

//删除博客点赞
export const deleteUserBlogLike = (id,user_id) => request({url:`/deleteRemark?id=${id}&user_id=${user_id}`,method:'DELETE'})

//删除博客收藏
export const deleteUserBlogCollection = (id,user_id) => request({url:`/deleteCollect?id=${id}&user_id=${user_id}`,method:'DELETE'})




//获取用户视频浏览记录
export const getUserVideoFoot = (id,num,size) => request({url:`/videoBrowse?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//获取用户视频点赞列表
export const getUserVideoLike = (id,num,size) => request({url:`/videoremark?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//获取用户视频收藏列表
export const getUserVideoCollection = (id,num,size) => request({url:`/videoCollect?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//删除用户视频浏览记录
export const deleteUserVideoFoot = (id,user_id) => request({url:`/videoBrowse?id=${id}&user_id=${user_id}`,method:'DELETE'})

//删除用户视频点赞
export const deleteUserVideoLike = (id,user_id) => request({url:`/videoRemark?id=${id}&user_id=${user_id}`,method:'DELETE'})

//删除用户视频收藏
export const deleteUserVideoCollection = (id,user_id) => request({url:`/videoCollect?id=${id}&user_id=${user_id}`,method:'DELETE'})





//获取用户博客评论列表
export const getUserBlogComment = (id,num,size) => request({url:`/userComment?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//删除用户博客评论
export const deleteUserBlogComment = (data) => request({url:'/userComment',method:'DELETE',data:data})

//获取用户视频评论列表
export const getUserVideoComment = (id,num,size) => request({url:`/videoComment?user_id=${id}&pageNum=${num}&pageSize=${size}`})

//删除用户视频评论
export const deleteUserVideoComment = (data) => request({url:'/videoComment',method:'DELETE',data:data})





//关键字查询博客浏览
export const searchBlogFoot = (id,keyword,num,size) => request({url:`/searchBrowse?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})

//关键字查询博客收藏
export const searchBlogCollection = (id,keyword,num,size) => request({url:`/searchCollect?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})

//关键字查询博客点赞
export const searchBlogLike = (id,keyword,num,size) => request({url:`/searchRemark?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})

//关键字查询视频收藏
export const searchVideoCollection = (id,keyword,num,size) => request({url:`/searchVideoCollect?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})

//关键字查询视频点赞
export const searchVideoLike = (id,keyword,num,size) => request({url:`/searchVideoRemark?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})

//关键字查询视频浏览
export const searchVideoFoot = (id,keyword,num,size) => request({url:`/searchVideoBrowse?keyword=${keyword}&user_id=${id}&pageNum=${num}&pageSize=${size}`})